package com.controller;


import com.dao.ResumeDao;
import com.model.Resume;
import com.model.Users;
import com.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 简历信息表 前端控制器
 * </p>
 *
 * @author Damon
 * @since 2021-04-29
 */
@RestController
@RequestMapping("/resume")
public class ResumeController {
    @Autowired
    private ResumeService resumeService;

//    @RequestMapping("/list")
//    public List<Resume> list() {
//        List<Resume> worklist = resumeService.list();
//        return worklist;
//    }
@RequestMapping("/list")
public List<Resume> list(String userKey) {
    List<Resume> worklist = resumeDao.ResumeList(new Users(userKey));
    return worklist;
}
    @RequestMapping("/edit")
    public boolean edit(Resume resume) {
        return resumeService.updateById(resume);
    }

    @RequestMapping("/select")
    public Resume select(int userKey) {
        return resumeService.getById(userKey);
    }

    @RequestMapping("/getById")
    public Resume getById(int id) {
        return resumeService.getById(id);
    }

    @Autowired(required = false)
    private ResumeDao resumeDao;
}

